home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEdynGlobalsTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.6 KB  |  138 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    Feb 8, 1999
  21. //  Author:            Carol Levy
  22. //
  23. //  Procedure Name:
  24. //    AEdynGlobalsTemplate
  25. //
  26. //  Description Name;
  27. //    Creates the attribute editor controls for dynGlobals Node
  28. //
  29. //  Input Value:
  30. //    nodeName 
  31. //
  32. //  Output Value:
  33. //    None
  34. // 
  35.  
  36. //
  37. //  Procedure Name:
  38. //    AEdynGlobalsTemplate
  39. //
  40.  
  41.  
  42. global proc oversampleCallback ( string $nodeName )
  43. {
  44.     // compare overSamples value to internalOverSamples value
  45.     //
  46.     string $nodeAttr = $nodeName + ".os";
  47.     int $value = `getAttr $nodeAttr`;
  48.     int $internalValue = `getAttr ($nodeName+".ios")`;
  49.  
  50.     if ( $value != $internalValue && ($internalValue > 0)) {
  51.         $value = $internalValue;
  52.         setAttr ($nodeAttr) $internalValue;
  53.         warning("Converting oversample value to nearest supported oversample value.");
  54.     } else if ($value != 1) {
  55.         float $playbackSpeed = `playbackOptions -q -by`;
  56.         float $osValue = (1.0/$value);
  57.         float $ratio = ($osValue / $playbackSpeed);
  58.         int $intRatio = $ratio;
  59.         if (($ratio - $intRatio) != 0) {
  60.             string $confirmString = "You will need to modify the Playback Speed in the Animation Preferences to ";
  61.             $confirmString += $osValue;
  62.             $confirmString += " in order for playback to match rendering with this oversampling setting.";
  63.             confirmDialog
  64.                 -m $confirmString
  65.                 -b "OK" -db "OK";
  66.         }
  67.     }
  68. }
  69.  
  70. global proc useParticleDiskCacheCallback ( string $nodeName )
  71. {
  72.         string $nodeAttr = $nodeName + ".useParticleDiskCache";
  73.         string $value = `getAttr $nodeAttr`;
  74.  
  75.         if ( $value ) {
  76.             if (`about -evalVersion`) {
  77.                 setAttr ($nodeAttr) 0;
  78.                 // Because dynExport is disabled in PLE, this attribute
  79.                 // is ignored, so don't bother letting people set it.
  80.                 //
  81.                 confirmDialog
  82.                     -m "Particle disk caching is not supported in Maya PLE."
  83.                     -b "Cancel" -db "Cancel";
  84.                 return;
  85.             }
  86.             
  87.                 // enable attribute controls.
  88.                 // but keep the min and max frame locked
  89.                 //
  90.                 editorTemplate -dimControl $nodeName "cacheDirectory" false;
  91.                 editorTemplate -dimControl $nodeName "minFrameCached" false;
  92.                 editorTemplate -dimControl $nodeName "maxFrameCached" false;
  93.                 // setAttr -lock true ($nodeName+".minFrameCached");
  94.                 // setAttr -lock true ($nodeName+".maxFrameCached");
  95.         } else {
  96.                 editorTemplate -dimControl $nodeName "cacheDirectory" true;
  97.                 editorTemplate -dimControl $nodeName "minFrameCached" true;
  98.                 editorTemplate -dimControl $nodeName "maxFrameCached" true;
  99.                 // setAttr -lock true ($nodeName + ".minFrameCached");
  100.                 // setAttr -lock true ($nodeName + ".maxFrameCached");
  101.         }
  102. }
  103.  
  104. global proc AEdynGlobalsTemplate ( string $nodeName )
  105. {
  106.     editorTemplate -beginScrollLayout;
  107.  
  108.         editorTemplate -beginLayout "Oversampling" -collapse 0;
  109.  
  110.             editorTemplate -addControl "overSamples"  "oversampleCallback";
  111.  
  112.         editorTemplate -endLayout;
  113.  
  114.         //editorTemplate -beginLayout "Particle Disk Cache for Rendering" -collapse 0;
  115.         editorTemplate -beginLayout "Particle Disk Cache" -collapse 0;
  116.  
  117.             editorTemplate -addControl "useParticleDiskCache" "useParticleDiskCacheCallback";
  118.             editorTemplate -addControl "cacheDirectory";
  119.             editorTemplate -addControl "minFrameCached";
  120.             editorTemplate -addControl "maxFrameCached";
  121.             // setAttr -lock true ($nodeName + ".minFrameCached");
  122.             // setAttr -lock true ($nodeName + ".maxFrameCached");
  123.  
  124.         editorTemplate -endLayout;
  125.  
  126.         // suppress some inherited attributes from the extras tab.
  127.         //
  128.         editorTemplate -suppress "nodeState";
  129.         editorTemplate -suppress "caching";
  130.         editorTemplate -suppress "pathVerified";
  131.         editorTemplate -suppress "confirmSceneName";
  132.  
  133.         editorTemplate -addExtraControls;
  134.  
  135.     editorTemplate -endScrollLayout;
  136. }
  137.  
  138.